package com.icloud.wallet.boot.schedule;

import com.icloud.common.database.mapper.CustomerWalletMapper;
import com.icloud.wallet.boot.constant.WalletConstants;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Slf4j
@Component
public class CalWithdrawableTask {
    @Autowired
    private CustomerWalletMapper customerWalletMapper;

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public void run(){
        customerWalletMapper.updateWithdrawable(WalletConstants.WITHDRAW_MAX_RATE);
    }
}
